import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-04-18
 * Time: 23:53
 */
public class IOdemo7 {
    public static void main(String[] args) {
        try (OutputStream outputStream = new FileOutputStream("test03.txt")) {
            // 覆盖写
            outputStream.write('a');
            outputStream.write('b');
            outputStream.write('c');
            // 所以即使是负值，依旧不影响写入
            byte[] b = {(byte)255, -65, 0, 0, 0, 0, 0, 0, 0, 0};
            outputStream.write(b);

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
